package org.blogwu.hyf.sso.main.service.Initialize;

import java.util.List;

import org.blogwu.hyf.sso.main.bean.daobean.BlogWuUser;
import org.blogwu.hyf.sso.main.dao.userDao.UserDao;
import org.blogwu.sso.until.redisUntil.jdeis.MyRedisTemplate;
import org.blogwu.sso.until.redisUntil.jdeis.RedisProperties;
import org.springframework.beans.factory.annotation.Autowired;

public class InitializeService {
	
	@Autowired
	UserDao userDao;
	
	MyRedisTemplate myRedisTemplate;
	
	
	public void getAllUser(){
		//初始化用户名进入redis
		List<BlogWuUser> alluser=userDao.findAll();//如果用户太多可能造成内存泄漏
		for(BlogWuUser bloguser :alluser ){
 			myRedisTemplate.set(RedisProperties.getPREFIX(), bloguser.getUsername(), bloguser.getEmail());
		}
		
		
	}
}
